<script setup lang="ts">
import en from "element-plus/es/locale/lang/en";
import zhCn from "element-plus/es/locale/lang/zh-cn";
import { computed } from "vue";
import { useI18n } from "vue-i18n";

const epLocaleList = {
    zh: zhCn,
    en,
};
const { locale } = useI18n();

/** element-plus 全局配置 */
const epConfig = {
    zIndex: 8000,
    locale: computed(() => epLocaleList[locale.value as keyof typeof epLocaleList] || zhCn),
    card: {
        shadow: "never",
    },
};
</script>

<template>
    <el-config-provider
        :z-index="epConfig.zIndex"
        :locale="epConfig.locale.value"
        :card="epConfig.card"
    >
        <RouterView />
    </el-config-provider>
</template>
